import axios from "axios";
import qs from "qs";
import rootApi from "../routerUrl";
const root = rootApi.gmcApiUrl;
const url = {
  getClassListApi: `${root}/Public/getClassListApi`,
  getStuTypesListApi: `${root}/Public/getStuTypesListApi`,
  getClassGradeListApi: `${root}/Public/getClassGradeListApi`,
  getClassTermListApi: `${root}/Public/getClassTermListApi`,

  getHobbyitemListApi: `${root}/Public/getHobbyitemListApi`,
  getHobbytypeListApi: `${root}/Public/getHobbytypeListApi`,

  getLosttypeListApi: `${root}/Public/getLosttypeListApi`,
  getCompaniesListApi: `${root}/Public/getCompaniesListApi`, //通用->获取园所所属企业下拉列表-
  getDistrictListApi: `${root}/Public/getDistrictListApi`, //通用->获取园所区域下拉列表
  getPostList: `${root}/Public/getPostList`, //通用->获取职务列表
  getPostLevelApi: `${root}/Public/getPostLevelApi`, //通用->获取职等下拉列表
  getStuchangeApi: `${root}/Public/getStuchangeApi`, //通用->获取异动类型下拉列表

  getProvinceApi: `${root}/Public/getProvinceApi`, //通用->获取省
  getCityApi: `${root}/Public/getCityApi`, //通用->获取市
  getAreaApi: `${root}/Public/getAreaApi`, //通用->获取区

  getFileApi: `${root}/Public/File`, //通用->上传文件
  getNoticeTypeList: `${root}/Public/getNoticeTypeList`, //通用->获取消息类别列表

  getAllSchoolApi: `${root}/Public/getAllSchoolApi`, //通用->获取所有园所下拉列表--qyh
  getSchoolClassApi: `${root}/Public/getSchoolClassApi`, //通用->获取园所下的班级下拉列表--qyh

  getPostroleApi: `${root}/Public/getPostroleApi`, //通用->获取集团角色下拉列表
  getPostpartApi: `${root}/Public/getPostpartApi`, //通用->获取校园角色下拉列表

  getOrganizeApi: `${root}/Public/getOrganizeApi`, //通用->获取组织下拉列表
  getOrganizeSchoolApi: `${root}/Public/getOrganizeSchoolApi`, //通用->获取组织所管辖园所下拉列表

  getFoodtypeApi: `${root}/Public/getFoodtypeApi`, //通用->获取菜肴类别下拉列表--qyh

  getCompanyidApi: `${root}/Company/getCompanyidApi`, // 登陆判断权限 获取数据

  getStafferPowerApi: `${root}/Company/getStafferPowerApi`, // 权限->登陆的职工所能看到的侧边栏
  getModuleList: `${root}/Post/getModuleList`, // 人事相关设置->集团权限列表
  addPowerAction: `${root}/Post/addPowerAction`, // 人事相关设置->添加权限
  addScPowerAction: `${root}/Post/addScPowerAction`, // 人事相关设置->添加权限（园所）
  getSchemeApi: `${root}/FinanceOrder/getSchemeApi`, // 财务管理->所有的方案-下拉
  getProductTypeApi: `${root}/Public/getProductTypeApi`, // 通用->货品类型下拉列表

  getSourceApi: `${root}/Client/getSourceApi`, // 招生管理->招生活动管理 渠道类型
  getChannelApi: `${root}/Client/getChannelApi`, // 招生管理->招生活动管理 获取渠道类型明细
};

export default {
  getSourceApi(params) {
    return axios.get(url.getSourceApi, {
      params,
    });
  },
  getChannelApi(params) {
    return axios.get(url.getChannelApi, {
      params,
    });
  },
  // 通用->获取园所所属企业下拉列表-
  getCompaniesListApi(params) {
    return axios.get(url.getCompaniesListApi, {
      params,
    });
  },
  getClassListApi(params) {
    return axios.get(url.getClassListApi, {
      params,
    });
  },
  getStuTypesListApi(params) {
    return axios.get(url.getStuTypesListApi, {
      params,
    });
  },
  getClassGradeListApi(params) {
    return axios.get(url.getClassGradeListApi, {
      params,
    });
  },
  getClassTermListApi(params) {
    return axios.get(url.getClassTermListApi, {
      params,
    });
  },
  getHobbyitemListApi(params) {
    return axios.get(url.getHobbyitemListApi, {
      params,
    });
  },
  getHobbytypeListApi(params) {
    return axios.get(url.getHobbytypeListApi, {
      params,
    });
  },
  getLosttypeListApi(params) {
    return axios.get(url.getLosttypeListApi, {
      params,
    });
  },
  //通用->获取园所区域下拉列表
  getDistrictListApi(params) {
    return axios.get(url.getDistrictListApi, {
      params,
    });
  },
  //通用->获取职务列表
  getPostList(params) {
    return axios.get(url.getPostList, {
      params,
    });
  },
  //通用->获取职等下拉列表
  getPostLevelApi(params) {
    return axios.get(url.getPostLevelApi, {
      params,
    });
  },
  //通用->获取异动类型下拉列表
  getStuchangeApi(params) {
    return axios.get(url.getStuchangeApi, {
      params,
    });
  },
  //通用->获取省
  getProvinceApi(params) {
    return axios.get(url.getProvinceApi, {
      params,
    });
  },
  //通用->获取市
  getCityApi(params) {
    return axios.get(url.getCityApi, {
      params,
    });
  },
  //通用->获取区
  getAreaApi(params) {
    return axios.get(url.getAreaApi, {
      params,
    });
  },

  //通用->上传文件
  getFileApi(params) {
    return axios.get(url.getFileApi, {
      params,
    });
  },
  //通用->获取消息类别列表
  getNoticeTypeList(params) {
    return axios.get(url.getNoticeTypeList, {
      params,
    });
  },

  //通用->获取所有园所下拉列表--qyh
  getAllSchoolApi(params) {
    return axios.get(url.getAllSchoolApi, {
      params,
    });
  },
  //通用->获取园所下的班级下拉列表--qyh
  getSchoolClassApi(params) {
    return axios.get(url.getSchoolClassApi, {
      params,
    });
  },

  //通用->获取集团角色下拉列表
  getPostroleApi(params) {
    return axios.get(url.getPostroleApi, {
      params,
    });
  },
  //通用->获取校园角色下拉列表
  getPostpartApi(params) {
    return axios.get(url.getPostpartApi, {
      params,
    });
  },

  //通用->获取组织下拉列表
  getOrganizeApi(params) {
    return axios.get(url.getOrganizeApi, {
      params,
    });
  },
  //通用->获取组织所管辖园所下拉列表
  getOrganizeSchoolApi(params) {
    return axios.get(url.getOrganizeSchoolApi, {
      params,
    });
  },

  // 通用->获取菜肴类别下拉列表--qyh
  getFoodtypeApi(params) {
    return axios.get(url.getFoodtypeApi, {
      params,
    });
  },
  //通用->货品类型下拉列表--qyh
  getProductTypeApi(params) {
    return axios.get(url.getProductTypeApi, { params });
  },

  // 登陆判断权限 获取数据
  getCompanyidApi(params) {
    return axios.get(url.getCompanyidApi, { params });
  },
  getStafferPowerApi(params) {
    return axios.get(url.getStafferPowerApi, { params });
  },
  getModuleList(params) {
    return axios.get(url.getModuleList, { params });
  },
  addPowerAction(params) {
    return axios.post(url.addPowerAction, qs.stringify(params));
  },
  addScPowerAction(params) {
    return axios.post(url.addScPowerAction, qs.stringify(params));
  },
  getSchemeApi(params) {
    return axios.get(url.getSchemeApi, { params });
  },
};
